package database

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/lib/pq"
	"time"
)


func InitDatabase()  {
	orm.RegisterDriver("postgres", orm.DRPostgres)
	// orm.RegisterDataBase("default", "postgres", "user=postgres password=postgres123 dbname=beego_test host=192.168.12.175 port=5433 sslmode=disable")
	// orm.RegisterDataBase("default", "postgres", "postgres:postgres123@tcp(192.168.12.175:5433)")
	orm.RegisterDataBase("default", "postgres", "postgres://postgres:postgres123@192.168.12.175:5433/beego_test?sslmode=disable")
	orm.RunSyncdb("default", true, true)
	orm.DefaultTimeLoc = time.UTC
}
